extends "../cTDZ_4_1_1/cTDZ_4_1_1.gd"
func _info():
	pass

func _connect():
	._connect()
var baseId = ""
func _extInit():
	._extInit()
	chaName = "异变晶蟹王"
	lv = 4
	attCoe.atk *= 1.6
	attCoe.maxHp *= 1.55
	attCoe.def = 50 / 15.0 / 4.0
	attCoe.mgiDef = 50 / 16.6 / 4.0 
	addCdSkill("hjxw3",9)
	addSkillTxt("晶体激活：嘲讽所有敌人，减伤增加65%，反弹20%伤害（特效除外）,持续3s[cd:9秒]")
	
func _castCdSkill(id):
	._castCdSkill(id)
	if id == "hjxw3":
		cst("晶体激活","000000",position)
		var chas = getAllChas(1)
		for i in chas:
			i.aiCha = self
		addBuff(JTJH.new(1))

class JTJH:
	extends Buff
	var canremove:bool = false
	func _init(lv):
		attInit()
		life = 3.0
		id = "JTJH"
		att.defR = 0.65

	#func _del():
	#	for i in masCha.getAllChas(1):
	#		if i.aiCha == masCha:
	#			i.aiCha = null

	func _connect():
		masCha.connect("onHurt",self,"run")
	
	func run(atkinfo):
		if atkinfo.isMiss || atkinfo.atkType == Chara.AtkType.EFF:return
		masCha.hurtChara(atkinfo.atkCha,atkinfo.hurtVal * 0.2,atkinfo.hurtType,Chara.AtkType.EFF)
		atkinfo.hurtVal *= 0.8